import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'lark_auth_platform_interface.dart';

/// An implementation of [LarkAuthPlatform] that uses method channels.
class MethodChannelLarkAuth extends LarkAuthPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('lark_auth');

  @override
  Future<String?> startSSOVerify({
    required String appId,
    bool? challengeMode = false,
    String? server = 'Feishu',
    String? language = 'zh',
    String? deviceId,
    List<String>? scopeList,
  }) async {
    final version = await methodChannel.invokeMethod<String>(
      'startSSOVerify',
      {
        "appId": appId,
        "challengeMode": challengeMode,
        "server": server,
        "language": language,
        "deviceId": deviceId,
        "scopeList": scopeList
      },
    );
    return version;
  }
}
